import request from "@/utils/request.js";


export default {

    /**
     * 微信小程序静默登录
     * @param params
     */
    wxXCXCodeAutoLogin(params) {
        console.log(JSON.stringify(params))
        return request(`/api/member/passport/wx/xcx/codeLogin`, params, "POST");
    },

    /**
     * 微信小程序手机号授权登录
     */
    wxXCXMobileAuthLogin(params) {
        return request(`/api/member/passport/wx/xcx/mobileAuthLogin`, params, "POST");
    },

    /**
     * 发送手机号登录验证码
     */
    sendLoginMobileSms(mobile) {
        let param = {
            data:{
                mobile: mobile
            }

        }
        return request(`/api/member/passport/sendLoginSms`, param, "POST");
    },

    /**
     * 发送手机号重置密码验证码
     */
    sendResetPwdSms(mobile) {
        let param = {
            data:{
                mobile: mobile
            }

        }
        return request(`/api/member/passport/sendResetPwdSms`, param, "POST");
    },

    /**
     * 短信验证码登录
     */
    smsLogin(params) {
        return request(`/api/member/passport/smsLogin`, params, "POST")
    },


    /**
     * 账号密码登录
     */
    userLogin(params) {
        return request(`/api/member/passport/login`, params, "POST");
    },

    /**
     * 退出登录
     */
    logout() {
        return request(`/api/member/passport/logout`, {}, "POST")
    },
    /**
     * 注销
     */
    logoff() {
        return request(`/api/member/passport/logoff`, {}, "POST")
    },

    /**
     * 重置密码
     */
    resetPwd(params) {
        return request(`/api/member/passport/resetPwd`, params, "POST")
    },

    /**
     * 重置密码-通过手机号验证码充值
     */
    resetPwdByMobile(params) {
        return request(`/api/member/passport/resetPwdByMobile`, params, "POST")
    },

    /**
     * 设置密码
     */
    setPwd(params) {
        return request(`/api/member/passport/setPwd`, params, "POST")
    },


    ////////////////////////////////////////////////

    /**
     * web 第三方登录
     * @param {Object} code
     */
    webConnect(code) {
        return request(`/passport/member/resetByMobile`, params, "POST");
    },
     openIdLogin(params, clientType) {
         return request(`/passport/member/resetByMobile`, params, "POST");
    },

    /**
     * 第三方登录成功 回调接口
     */
     loginCallback(state) {
        return request(`/passport/member/resetByMobile`, params, "POST");
    },

    /**
     * 绑定手机号码
     * @param  mobile
     */
    unbindMobile(params) {
        return request(`/passport/member/unbindMobile`, params, "POST");
    },

    //获取自动发券
    getAutoCoup() {
        return request(`/api/member/promotion/coupon/activity`, {}, "GET");
    },

}


